import { RouteRecordRaw } from "vue-router";

const routes: RouteRecordRaw[] = [
  {
    path: "/",
    redirect: { name: "lesson1" },
  },
  {
    path: "/lesson1",
    name: "lesson1",
    component: () => import("@/lesson1/index.vue"),
    meta: {
      title: "lesson1",
    },
    children: [
      {
        path: "chapter1",
        component: () => import("@/lesson1/chapter1/index.vue"),
        meta: {
          title: "第一个场景",
        },
      },
      {
        path: "chapter2",
        component: () => import("@/lesson1/chapter2/index.vue"),
        meta: {
          title: "材质和光照",
        },
      },
      {
        path: "chapter3",
        component: () => import("@/lesson1/chapter3/index.vue"),
        meta: {
          title: "材质、光照、动画",
        },
      },
      {
        path: "chapter4",
        component: () => import("@/lesson1/chapter4/index.vue"),
        meta: {
          title: "交互控制",
        },
      },
      {
        path: "chapter5",
        component: () => import("@/lesson1/chapter5/index.vue"),
        meta: {
          title: "响应窗口变化",
        },
      },
    ],
  },
  {
    path: "/lesson2",
    name: "lesson2",
    component: () => import("@/lesson2/index.vue"),
    meta: {
      title: "lesson2",
    },
    children: [
      {
        path: "chapter1",
        component: () => import("@/lesson2/chapter1/index.vue"),
        meta: {
          title: "添加移除网格体",
        },
      },
      {
        path: "chapter2",
        component: () => import("@/lesson2/chapter2/index.vue"),
        meta: {
          title: "雾化",
        },
      },
      {
        path: "chapter3",
        component: () => import("@/lesson2/chapter3/index.vue"),
        meta: {
          title: "重写材质",
        },
      },
      {
        path: "chapter4",
        component: () => import("@/lesson2/chapter4/index.vue"),
        meta: {
          title: "更改集合体的属性",
        },
      },
    ],
  },
];
export default routes;
